var initialState={title:'',desc:'',lists:[]};



const reducer=(state=initialState,action) =>{
    const {payload,type} =action;
    switch (type) {
        //redux里面只能用数据复制形式，或者是对象合并
        case "TITLE":
            // return {count:state.count +1};
            return Object.assign({},state,{title:payload});
            // return {...state, count:state.count + 1};
        break;
        case "DESC":
            // return {count1:state.count1 -1};
            return Object.assign({},state,{desc:payload});
            // return {...state , count1:state.count1 - 1};
            
        break;
        case "GETLISTS":   
            return Object.assign({},state,{lists:payload});    
            // return {...state , lists:[...state,lists,payload]};
                   
        break;
        default:
        return state;
    }
};

export default reducer;